<template>
    <div :key="dealWithKey">
        <!-- <div style="position: fixed;top: 10px;background-color: brown;color: #fff;z-index: 100000;left: 50%;">
            {{ parameterData.sqsxbm }}
        </div> -->
        <!-- 001002058 SOOQSNSIMGCYQINYTE -->
        <dealWith005 v-if="parameterData.sqsxbm == '001002005'" ref="dealWithRef" :parameter="parameterData" @successReturn="successReturn" @updatedSuccess="updatedSuccess"/>
        <dealWith001 v-else-if="parameterData.sqsxbm == '001002001'" ref="dealWithRef" :parameter="parameterData" @successReturn="successReturn" @updatedSuccess="updatedSuccess"/>
        <dealWith035 v-else-if="parameterData.sqsxbm == '001002035'" ref="dealWithRef" :parameter="parameterData" @successReturn="successReturn" @updatedSuccess="updatedSuccess"/>
        <dealWith051 v-else-if="parameterData.sqsxbm == '001002051'" ref="dealWithRef" :parameter="parameterData" @successReturn="successReturn" @updatedSuccess="updatedSuccess"/>
        <dealWith003 v-else-if="parameterData.sqsxbm == '001002003'" ref="dealWithRef" :parameter="parameterData" @successReturn="successReturn" @updatedSuccess="updatedSuccess"/>
        <dealWith028 v-else-if="parameterData.sqsxbm == '001002028'" ref="dealWithRef" :parameter="parameterData" @successReturn="successReturn" @updatedSuccess="updatedSuccess"/>
        <dealWith026 v-else-if="parameterData.sqsxbm == '001002026'" ref="dealWithRef" :parameter="parameterData" @successReturn="successReturn" @updatedSuccess="updatedSuccess"/>
        <dealWith016 v-else-if="parameterData.sqsxbm == '001002016'" ref="dealWithRef" :parameter="parameterData" @successReturn="successReturn" @updatedSuccess="updatedSuccess"/>
        <dealWith058 v-else-if="parameterData.sqsxbm == '001002058'" ref="dealWithRef" :parameter="parameterData" @successReturn="successReturn" @updatedSuccess="updatedSuccess"/>
        <dealWith013 v-else-if="parameterData.sqsxbm == '001002013'" ref="dealWithRef" :parameter="parameterData" @successReturn="successReturn" @updatedSuccess="updatedSuccess"/>
        <dealWith v-else ref="dealWithRef" :parameter="parameterData" @successReturn="successReturn" @updatedSuccess="updatedSuccess" @linkHandlingReturn="linkHandlingReturn"/>
    </div>
</template>
<script>
import dealWith from './dealWith.vue'
import dealWith005 from './dealWith-005.vue'
import dealWith001 from './dealWith-001.vue'
import dealWith035 from './dealWith-035.vue'
import dealWith051 from './dealWith-051.vue'
import dealWith003 from './dealWith-003.vue'
import dealWith028 from './dealWith-028.vue'
import dealWith026 from './dealWith-026.vue'
import dealWith016 from './dealWith-016.vue'
import dealWith058 from './dealWith-058.vue'
import dealWith013 from './dealWith-013.vue'
import {getSqsxBm} from './service/index.js'
export default {
    components:{
        dealWith,
        dealWith005,
        dealWith001,
        dealWith035,
        dealWith051,
        dealWith003,
        dealWith028,
        dealWith026,
        dealWith016,
        dealWith058,
        dealWith013,
    },
    props:{

    },
    data(){
        return{
            parameterData:{},
            dealWithKey:null,
        }
    },
    watch:{

    },
    mounted(){
        
    },
    methods:{
        getDatas(val){
            //console.log('没有数据进来吗？',val)
            this.$store.dispatch('UpdateSpinningPrice', {key:true,stateKey:'modalSpinningPrice'})
            if(val.sqsxid){
                getSqsxBm({sqsxid:val.sqsxid}).then(res=>{
                    if(res.code == 200){
                        val['sqsxbm'] = res.result
                        //console.log('获取到什么啊！',val)
                        this.parameterData = val
                        this.dealWithKey = Date.now()
                        this.$nextTick(()=>{
                            this.$store.dispatch('UpdateSpinningPrice', {key:true,stateKey:'modalSpinningPrice'})
                            this.$refs.dealWithRef.getDatas(val)
                        })
                    }else{
                        this.$message.warning(res.message)
                    }
                })
            }else{
                this.$nextTick(()=>{
                    this.$store.dispatch('UpdateSpinningPrice', {key:true,stateKey:'modalSpinningPrice'})
                    this.$refs.dealWithRef.getDatas(val)
                })
            }
            
        },
        updatedSuccess(){
            this.$emit('updatedSuccess')
        },
        successReturn(val){
            this.$emit('successReturn',val)
        },
        linkHandlingReturn(val){
            //console.log('到中间拿到什么',val)
            this.$emit('linkHandlingReturn',val)
        }
    }
}
</script>